$(function () {
    $(".center").click(function () {
        alert("cen");
        // $(this).css("border","3px red solid");
        //   $(this).prevAll().css("border","3px ");
        //   $(this).nextAll().css("border","3px ");
    })
})


function abc(){
    $("form").attr("action","/material/saveImg").submit();
}
function imgError(image){
    $(image).hide();
}
var ImgId;
function imgclick(id){//onmouseover
    /*   alert("ImgId");*/  //onclick
    ImgId=id;
}

$.post("/material/SelectImg",function (data) {
    var obj = eval("("+data+")");
    for(var key in obj){ //第一层循环取到各个list   onclick='imgclick("+obj[key].id+")' onerror='imgError(this);'
        var _e="<img class='center' style='height: 100px;width: 100px;display:inline-block;'  src=/upload/"+obj[key].url+"   onerror='imgError(this);' />";
        var de="<div   style='height: 100px;width: 100px;display:inline-block;border: 3px;' onmouseover=imgclick("+obj[key].id+")>" +_e +"</div>";
        $("#center").append(de);//TwoLevelMenu
    }
    /*  window.reload();*/
})